package de.fhluebeck.oop.gps.gui;
import java.util.Random;

import javax.swing.JTextField;
import javax.swing.SwingUtilities;

/**
* 
* Eigener Thread, welche eine Umkreissuche simuliert.
* @author Ogün Bilge, Leif Hitzschke
* @version 1.00, 13.11.2009
* 
*/

public class ThreadUmkreissuche extends Thread {
	
	private JTextField _umkreis = new JTextField();
	private Random random;
	// Konstruktor der Klasse
	public ThreadUmkreissuche(String name, JTextField umkreis) {
		super(name);
		_umkreis = umkreis;
		random = new Random();
	}
	
	public void run(){
		try {
		
			Thread.sleep(500);
			SwingUtilities.invokeLater(new Runnable(){
				@Override
				public void run() {
					_umkreis.setText(String.valueOf(random.nextInt(100)));
				}
			}
			);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
